<?php
require_once(dirname(__FILE__)."/../lib/Loader.php");
cfgload("defines");
cload("Smarty.smartyRenderer");
cload("requestProcessor");
cload("user.usersList");
cload("user.user");
/**
 * Description of admUsersList
 *
 * @author Di_Moon
 */
class admUsersList extends smartyRenderer {
    protected $_dbh;
    
    function __construct($dbh) {
        parent::__construct();
        
        $this->_dbh = $dbh;
        
        $_action = requestProcessor::getVar("action");
        
        if($_action!="") {
            $_id = (int)requestProcessor::getVar("id");
            if($_id!=0) {
                $user = new user($this->_dbh, $_id);
                if($_action=="enable") $user->enableUser();
                if($_action=="disable") $user->disableUser();
            }
        }
    }
    
    function render() {
        $_usersList = new usersList($this->_dbh);
        $this->assign("usersList", $_usersList->getListArray());
        
        return $this->fetch("admUsersList.tpl");
    }
}

?>
